<template>
  <el-dialog
    top="30px"
    width="80%"
    append-to-body
    class="dialog-sm"
    title="限率评审"
    :visible.sync="visible"
    :close-on-click-modal="false"
    :before-close="beforeClose"
  >
    <el-tabs v-model="active">
      <el-tab-pane label="未审查" name="todo">
        <task-hnd-approval-panel
          :task-status="0"
          :visible.sync="visible"
          @success="handleTodoSuccess"
        ></task-hnd-approval-panel>
      </el-tab-pane>
      <el-tab-pane label="已审查" name="finish">
        <task-hnd-approval-panel
          :task-status="1"
          :visible.sync="visible"
          ref="finishRef"
        ></task-hnd-approval-panel>
      </el-tab-pane>
    </el-tabs>
  </el-dialog>
</template>

<script>
import TaskHndApprovalPanel from '@/credit/views/city/index/myTask/TaskHndApprovalPanel'

export default {
  components: {
    TaskHndApprovalPanel,
  },
  props: {
    visible: Boolean,
  },
  data() {
    return {
      active: 'todo',
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    beforeClose() {
      this.active = 'todo'
      this.$emit('update:visible', false)
    },
    handleTodoSuccess() {
      this.$refs.finishRef.getData()
    },
  },
}
</script>

<style lang="scss" scoped></style>
